//JETNUKE

/*
 * Copyright (c) 2004-2006 by Andrea Mazzolini [andreamazzolini@users.sourceforge.net]
 * http://www.jetnuke.org
 * 
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307, USA.
 *  
 */

package org.jetnuke.entities;

import org.apache.log4j.Logger;

import java.util.Date;

import org.jetnuke.util.StringUtils;

public class BlogPost {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(BlogPost.class);

	private int iD;
	private int aID;
	private Date pOSTDATE;
	private String pOSTCONTENT;
	private String pOSTTITLE;
	private int pOSTCATEGORY;
	private String pOSTEXCERPT;
	private String tOPING;
	private String pINGED;
	private Date pOSTMODIFIED;
	private String gUID;
	private String pOSTSTATUS;
	private String cOMMENTSTATUS;
	private String pINGSTATUS;
	private String pOSTPASSWORD;

	public int getAID() {
		return aID;
	}

	public void setAID(int aid) {
		aID = aid;
	}

	public String getCOMMENTSTATUS() {
		return cOMMENTSTATUS;
	}

	public void setCOMMENTSTATUS(String commentstatus) {
		cOMMENTSTATUS = commentstatus;
	}

	public String getGUID() {
		return gUID;
	}

	public void setGUID(String guid) {
		gUID = guid;
	}

	public int getID() {
		return iD;
	}

	public void setID(int id) {
		iD = id;
	}

	public String getPINGED() {
		return pINGED;
	}

	public void setPINGED(String pinged) {
		pINGED = pinged;
	}

	public String getPINGSTATUS() {
		return pINGSTATUS;
	}

	public void setPINGSTATUS(String pingstatus) {
		pINGSTATUS = pingstatus;
	}

	public int getPOSTCATEGORY() {
		return pOSTCATEGORY;
	}

	public void setPOSTCATEGORY(int postcategory) {
		pOSTCATEGORY = postcategory;
	}

	public String getPOSTCONTENT() {
		return pOSTCONTENT;
	}

	public void setPOSTCONTENT(String postcontent) {
		pOSTCONTENT = postcontent;
	}

	public Date getPOSTDATE() {
		return pOSTDATE;
	}

	public void setPOSTDATE(Date postdate) {
		pOSTDATE = postdate;
	}

	public String getPOSTEXCERPT() {
		return pOSTEXCERPT;
	}

	public void setPOSTEXCERPT(String postexcerpt) {
		pOSTEXCERPT = postexcerpt;
	}

	public Date getPOSTMODIFIED() {
		return pOSTMODIFIED;
	}

	public void setPOSTMODIFIED(Date postmodified) {
		pOSTMODIFIED = postmodified;
	}

	public String getPOSTPASSWORD() {
		return pOSTPASSWORD;
	}

	public void setPOSTPASSWORD(String postpassword) {
		pOSTPASSWORD = postpassword;
	}

	public String getPOSTSTATUS() {
		return pOSTSTATUS;
	}

	public void setPOSTSTATUS(String poststatus) {
		pOSTSTATUS = poststatus;
	}

	public String getPOSTTITLE() {
		return pOSTTITLE;
	}

	public void setPOSTTITLE(String posttitle) {
		pOSTTITLE = posttitle;
	}

	public String getTOPING() {
		return tOPING;
	}

	public void setTOPING(String toping) {
		tOPING = toping;
	}

	public String getSHORTTEXT() {
		if (logger.isDebugEnabled()) {
			logger.debug("getSHORTTEXT() - start"); //$NON-NLS-1$
		}

		String tmp = null;
		if (pOSTEXCERPT != null && pOSTEXCERPT.trim().length() > 0) {
			tmp = pOSTEXCERPT;

		} else {
			tmp = pOSTCONTENT;
		}
		if (tmp == null)
			return "";
		tmp = StringUtils.filterText(tmp, true);
		if (tmp.length() > 80) {
			tmp = tmp.substring(0, 80);
			tmp = tmp + "...";
		}

		if (logger.isDebugEnabled()) {
			logger.debug("getSHORTTEXT() - end"); //$NON-NLS-1$
		}
		return tmp;
	}
}
